package file;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
        /*
        File file=new File("C:/Users/tarena/IdeaProjects/jsd2407");//绝对路径
        System.out.println(file.getName());//名字
        System.out.println(file.length());//字节
        System.out.println(file.canRead());//是否可读
        System.out.println(file.canWrite());//是否可写
        System.out.println(file.isHidden());//是否隐藏
         */
        File file=new File("./demo.txt");//相对路径
        System.out.println(file.getName());//名字
        System.out.println(file.length());//字节
        System.out.println(file.canRead());//是否可读
        System.out.println(file.canWrite());//是否可写
        System.out.println(file.isHidden());//是否隐藏
    }
}
